import { rPost } from "@/server/function.js";

// import request from '@/utils/request'

const prefix = "api/";

// /** 学生信息 */
// export const addStudentInfo = (data) => rPost(`/${prefix}/add`, data)
// export const delStudentInfo = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editStudentInfo = (data) => rPost(`/${prefix}/update`, data)
// export const getStudentInfo = (data) => rPost(`/${prefix}/find`, data)

// /** 班级整体评价 */
// export const addClassOverallEval = (data) => rPost(`/${prefix}/add`, data)
// export const delClassOverallEval = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editClassOverallEval = (data) => rPost(`/${prefix}/update`, data)
// export const getClassOverallEval = (data) => rPost(`/${prefix}/find`, data)

// /** 生生互评 */
// export const addPeerReview = (data) => rPost(`/${prefix}/add`, data)
// export const delPeerReview = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editPeerReview = (data) => rPost(`/${prefix}/update`, data)
// export const getPeerReview = (data) => rPost(`/${prefix}/find`, data)

// /** 教师主评 */
// export const addTeacherEval = (data) => rPost(`/${prefix}/add`, data)
// export const delTeacherEval = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editTeacherEval = (data) => rPost(`/${prefix}/update`, data)
// export const getTeacherEval = (data) => rPost(`/${prefix}/find`, data)

// /** 专家联评 */
// export const addExpertJointEval = (data) => rPost(`/${prefix}/add`, data)
// export const delExpertJointEval = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editExpertJointEval = (data) => rPost(`/${prefix}/update`, data)
// export const getExpertJointEval = (data) => rPost(`/${prefix}/find`, data)

// /** 平台测评 */
// export const addPlatformEval = (data) => rPost(`/${prefix}/add`, data)
// export const delPlatformEval = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editPlatformEval = (data) => rPost(`/${prefix}/update`, data)
// export const getPlatformEval = (data) => rPost(`/${prefix}/find`, data)

// /** 主管监评 */
// export const addSupervisoryEval = (data) => rPost(`/${prefix}/add`, data)
// export const delSupervisoryEval = (data) => rPost(`/${prefix}/delete`, null, data)
// export const editSupervisoryEval = (data) => rPost(`/${prefix}/update`, data)
// export const getSupervisoryEval = (data) => rPost(`/${prefix}/find`, data)

/* * 学生信息 */
export const addStudentInfo = (data) => {
  return rPost(`/${prefix}/add`, data);
};
export const delStudentInfo = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editStudentInfo = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getStudentInfo = (data) => {
  return new Promise((resolve) => {
    const list = [
      {
        name: "张xx",
        imgUrl: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
        grade: "2023级",
      },
      {
        name: "xxxx",
        imgUrl: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
        grade: "2023级",
      },
      {
        name: "xxx",
        imgUrl: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
        grade: "2023级",
      },
      {
        name: "xx",
        imgUrl: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
        grade: "2023级",
      },
    ];
    resolve({ data: list });
  });
  //   return rPost(`/${prefix}/find`, data);
};

/** 班级整体评价 */
export const addClassOverallEval = (data) => {
  return rPost(`/${prefix}/add`, data);
};
export const delClassOverallEval = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editClassOverallEval = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getClassOverallEval = (data) => {
  // return rPost(`/${prefix}/find`, data);
  return new Promise((resolve) => {
    const list = [
      {
        subjectName: "学习氛围及成绩",
        score: 25,
      },
      {
        subjectName: "班级凝聚力",
        score: 25,
      },
      {
        subjectName: "班级管理",
        score: 25,
      },
      {
        subjectName: "活动参与度",
        score: 25,
      },
    ];
    resolve({ data: list });
  });
};

/** 生生互评 */
export const addPeerReview = (data) => {
  // return rPost(`/${prefix}/add`, data);
};
export const delPeerReview = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editPeerReview = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getPeerReview = (data) => {
  // return rPost(`/${prefix}/find`, data);
  return new Promise((resolve) => {
    const list = [
      {
        score: 99,
        subjectName: "学习态度",
      },
      {
        score: 79,
        subjectName: "沟通能力",
      },
      {
        score: 88,
        subjectName: "合作能力",
      },
      {
        score: 80,
        subjectName: "解题能力",
      },
      {
        score: 81,
        subjectName: "批判性思维",
      },
    ];
    resolve({ data: list });
  });
};

/** 教师主评 */
export const addTeacherEval = (data) => {
  return rPost(`/${prefix}/add`, data);
};
export const delTeacherEval = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editTeacherEval = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getTeacherEval = (data) => {
  return new Promise((resolve) => {
    const list = [
      {
        period: 2022,
        subject1: 19,
        subject2: 99,
        subject3: 99,
        subject4: 99,
      },
      {
        period: 2023,
        subject1: 59,
        subject2: 47,
        subject3: 28,
        subject4: 36,
      },
    ];
    resolve({ data: list });
  });
  // return rPost(`/${prefix}/find`, data);
};

/** 专家联评 */
export const addExpertJointEval = (data) => {
  return rPost(`/${prefix}/add`, data);
};
export const delExpertJointEval = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editExpertJointEval = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getExpertJointEval = (data) => {
       
  return new Promise((resolve) => {
    const list = [
      {
        period: 2022,
        subject1: 19,
        subject2: 99,
        subject3: 99,
        subject4: 99,
      },
      {
        period: 2023,
        subject1: 59,
        subject2: 43,
        subject3: 33,
        subject4: 99,
      },
    ]
    resolve({ data: list });
  });
  // return rPost(`/${prefix}/find`, data);
};

/** 平台测评 */
export const addPlatformEval = (data) => {
  return rPost(`/${prefix}/add`, data);
};
export const delPlatformEval = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editPlatformEval = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getPlatformEval = (data) => {
  return new Promise((resolve) => {
    const list = [
      {
        period: 2022,
        subject1: 79,
        subject2: 59,
        subject3: 99,
        subject4: 89,
        subject5: 79,
        subject6: 79,
      },
    ];
    resolve({ data: list });
  });
  //   return rPost(`/${prefix}/find`, data);
};

/** 主管监评 */
export const addSupervisoryEval = (data) => {
  return rPost(`/${prefix}/add`, data);
};
export const delSupervisoryEval = (data) => {
  return rPost(`/${prefix}/delete`, null, data);
};
export const editSupervisoryEval = (data) => {
  return rPost(`/${prefix}/update`, data);
};
export const getSupervisoryEval = (data) => {
  return new Promise((resolve) => {
    const list = [
        {
          subjectName: "遵守规章制度",
          period: 2022,
          score: 19,
        },
        {
          subjectName: "参与课外活动",
          period: 2023,
          score: 75,
        },
        {
          subjectName: "综合素质评价",
          period: 2023,
          score: 95,
        }
    ];
    resolve({ data: list });
  });
  // return rPost(`/${prefix}/find`, data);
};

// 查询分数信息列表
// export function listScore_info(query) {
//   return rPost({
//     url: '/system/score_info/list',
//     method: 'get',
//     params: query
//   })

//   return rPost({
//     url: '',
//     method: 'get',
//     params: query
//   })
// }

